﻿@using DIS.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "CityTaxiFeeSummaryDetail";
    Layout = "~/Views/Shared/_Layout.cshtml";
    List<CityTaxiDetail> list = ViewBag.data;
    Project project = ViewBag.project;
    FinancialPeriod fp = ViewBag.financialPeriod;
}
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D6D6D6">
    <tr>
        <td height="19" background="/content/img/tbg.gif" bgcolor="#E7E7E7">
            <table width="96%" border="0" cellspacing="1" cellpadding="1">
                <tr>
                    <td style="padding-left: 10px;">
                        <b><strong>市内交通费明细</strong></b>
                    </td>
                    <td align="right">
                        <b><strong><a href="/SummaryData/CityTaxiFeeSummary">市内交通费列表</a></strong></b>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="center" valign="top" bgcolor="#FFFFFF">
            
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D6D6D6">
                <tr height="30px">
                    <td colspan="5" align="left">
                        <strong>勘察记录表</strong>&nbsp;&nbsp;
                        @{
                            if(fp!=null)
                            {
                                <span>@(fp.Year)年@(fp.Month)月(@fp.StartDate - @fp.EndDate)</span>
                            }
                        }
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <strong>项目名称</strong>&nbsp;&nbsp;
                        @{
                            if(project!=null)
                            {
                                <span>@(project.ProjectName)(@project.ProjectCode)</span>
                            }
                        }
                    </td>
                    <td colspan="2" align="right">
                    <a href="/SummaryData/CityTaxiFeeExcel?year=@fp.Year&month=@fp.Month&projectId=@project.Id">导出Excel</a>
                    </td>
                </tr>
                <tr>
                    <td colspan="7">
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
                            <thead>
                                <tr bgcolor="#FBFCE2">
                                    <td height="30" width="5%"  align="center">序号</td>
                                    <td width="10%" height="30" align="center">
                                        姓名
                                    </td>
                                    <td width="20%" height="30" align="center">
                                        勘察日期
                                    </td>
                                    <td width="20%" height="30" align="center">
                                        出差地点
                                    </td>
                                    <td width="25%" height="30" align="center">
                                        勘察站名
                                    </td>
                                    <td width="10%" height="30" align="center">
                                        出租车费
                                    </td>
                                    <td width="10%" height="30" align="center">
                                        发票数
                                    </td>
                                     
                                </tr>
                            </thead>
                            <tbody>
                            @{
                                int totalcount=0;
                                decimal totalfee=0;
                                if(list!=null&&list.Any())
                                {
                                    int i=1;
                                    foreach(var item in list)
                                    {
                                        totalcount = totalcount + item.InvoiceCount;
                                        totalfee = totalfee + item.TaxiFee;
                                        <tr bgcolor="#ffffff">
                                           <td>@i</td>
                                        <td width="10%" align="center">
                                            @item.cityTaxi.user.RealName
                                        </td>
                                        <td width="20%"  align="center">
                                            @item.ReconnaissanceDate
                                        </td>
                                        <td width="20%" align="center">
                                            @item.TravelAddress
                                        </td>
                                        <td width="25%" align="center">
                                            @item.ReconnaissanceName
                                        </td>
                                        <td width="10%"  align="center">
                                            @item.TaxiFee
                                        </td>
                                        <td width="10%"  align="center">
                                            @item.InvoiceCount
                                        </td>
                                         
                                    </tr>
                                        i++;
                                    }
                                }
                            }
                            </tbody>
                            <tfoot>
                                <tr bgcolor="#FBFCE2" align="center" class="hover">
                                    <td width="15%" colspan="2" align="center">
                                        <font><b>合计</b></font>
                                    </td>
                                    <td width="20%">
                                        &nbsp;
                                    </td>
                                    <td width="20%">
                                        &nbsp;
                                    </td>
                                    <td width="25%">
                                        &nbsp;
                                    </td>
                                    <td width="10%">
                                        <span name="stotalfee" id="stotalfee" value="0">@totalfee</span>
                                    </td>
                                    <td width="10%">
                                        <span name="stotalcount" id="stotalcount" value="0">@totalcount</span>
                                    </td>
                                   
                                </tr>
                                <tr bgcolor="#FFFFFF" align="center" class="hover">
                    <td align="left" colspan="7">
                        <b><font style="color: red">说明：本表作为每月报销差旅费附件。</font></b>
                    </td>
                </tr>
                            </tfoot>
                        </table>
                    </td>
                </tr>
                
            </table>
        </td>
    </tr>
</table>
